package pkg

import (
	"fmt"
	"github.com/robfig/cron/v3"
	"week53/common/model/mysql"
)

func Cron(OrderSn string) {
	c := cron.New(cron.WithSeconds())
	spec := "0 */10 * * * ?"
	_, err := c.AddFunc(spec, func() {
		o := mysql.Order{}
		o.UpdatedOrder(OrderSn)
	})
	fmt.Println(err)
	c.Start()

	select {}
}
